"""
多态
    继承
    重写
"""


class Animal:
    def say(self):
        print("i am a animal")


class Cat(Animal):
    def say(self):
        print("i am a cat")


class Dog(Animal):
    def say(self):
        print("i am a dog")


class Duck(Animal):
    def say(self):
        print("i am a duck")


animals = [Cat, Dog, Duck]

for animal in animals:
    animal().say()
